package com.biz.primus.ms.oms.dao.po;

import com.biz.primus.model.oms.enums.PrivilegeBehavior;
import com.biz.primus.ms.base.jpa.po.BaseEntity;
import lombok.Data;

import javax.persistence.*;

/**
 * @author yanweijin
 * @date 2017/10/30
 */
@Entity
@Table(name = "oms_order_item_apportionment", indexes = {
		@Index(name = "idx_order_id", columnList = "orderId")
})
@Data
public class OrderApportionment extends BaseEntity{


	@Column(nullable = false)
	private Long orderId;

	/**
	 * promotion: 活动
	 * coupon: 优惠券
	 * 理论上,能分摊到订单的促销记录一定是活动
	 */
	@Column(length = 64, nullable = false)
	private String mode = "promotion";


	/**
	 * 具体的促销/优惠券类型
	 */
	@Column(length = 64)
	private String type;

	@Enumerated(EnumType.STRING)
	@Column(length = 64, nullable = false)
	private PrivilegeBehavior behavior;

	@Column(length = 200)
	private String name;

	@Column(length = 128)
	private String uid;

	@Column(columnDefinition = "TEXT")
	private String ext;

}
